import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
import javax.swing.*;

public class MainFrame extends JPanel
{
  static MysqlTest database = new MysqlTest();
  static int page = 1;
 
  /* Frame */
  static JFrame frame;
  static Canvas canvas;
  static JPanel panel;
  static JLabel backgroundImage;
  

  /* Pages */
  static Header header;
  static loginPage loginPage;
  static homePage homePage;
  static settingsPage settingsPage;
  static patientsPage patientsPage;
  static appointmentsPage appointmentsPage;
  static servicesPage servicesPage;
  
  public void MainFrame(){
      
        /* Frame Options */
        frame = new JFrame("Aplasca - Liganor Dental Clinic: Patient Archive and Appointments Manager");
        frame.setSize(800,625);

        /* Panel Options*/
        panel = new JPanel();
        panel.setPreferredSize(new Dimension(800, 600));
        panel.setLayout(null);
        
        /* Instantiate Pages*/
        header = new Header();
        loginPage = new loginPage();
        homePage = new homePage();
        settingsPage = new settingsPage();
        patientsPage = new patientsPage();
        appointmentsPage = new appointmentsPage();
        servicesPage = new servicesPage();
        
        /*Draw First Page */
        loginPage.Draw();
        
        /* Background Image */
        backgroundImage = new JLabel(new ImageIcon("background.jpg"));  
        backgroundImage.setBounds(0,0,800,600);
        panel.add(backgroundImage);
        
        /* Frame Operations */
        frame.getContentPane().add(panel);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setResizable(false);
        frame.setVisible(true);
        
  }
  
  public static void main(String[] args) {
        database.test();
        
        MainFrame run = new MainFrame();
        run.MainFrame();
  }

  }  

